/**
 * 
 */
package com.gragra.sequentiaDataGenerator.tests;
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import com.gragra.sequentiaDataGenerator.CaseLevelAssigningSegmenter;
import com.gragra.sequentiaDataGenerator.PunctuationSplitOffSegmenter;
/**
 * @author Christoph Teichmann
 * created Mar 27, 2013 4:37:53 PM
 * @version 0.1
 */
public class TestCaseLevelAssigning
{
	/**
	 * Test method for {@link com.gragra.sequentiaDataGenerator.CaseLevelAssigningSegmenter#segment(java.lang.String)}.
	 */
	@Test
	public final void testSegment()
	{
		PunctuationSplitOffSegmenter pss = new PunctuationSplitOffSegmenter("NONE");
		CaseLevelAssigningSegmenter clas = new CaseLevelAssigningSegmenter(pss);
		Collection<String[]> s = clas.segment("-.Hans-peter.-|Noun|WordTypeLevel|Noun");
		s = clas.segment("Hans-martin-peter.-|Noun|WordTypeLevel|Noun");
		assertEquals(s.size(),3);
		int i = 0;
		for(String[] arr : s)
		{
			switch (i++)
			{
			case 0:
				assertEquals("[hans-martin-peter, Noun, WordTypeLevel, Noun, CaseTypeLevel, UpperCase]",Arrays.toString(arr));
				break;
			case 1:
				assertEquals("[., NONE, CaseTypeLevel, DownCase]",Arrays.toString(arr));
				break;
			case 2:
				assertEquals("[-, NONE, CaseTypeLevel, DownCase]",Arrays.toString(arr));
				break;
			}
		}
	}
}